package jmine.tec.aom.builder;

import jmine.tec.aom.domain.AbstractPropertyValue;
import jmine.tec.aom.domain.PropertyType;
import jmine.tec.aom.domain.impl.StringPropertyValue;
import bancosys.tec.persist.builders.AbstractDBBuilder;

/**
 * @author jrenaut
 */
public class PropertyTypeBuilder extends AbstractDBBuilder<PropertyType> {

    public static PropertyTypeBuilder aPropertyType() {
        return new PropertyTypeBuilder();
    }

    private String mnemonic = "a property type";

    private String propertyValueClass = StringPropertyValue.class.getName();

    /**
     * {@inheritDoc}
     */
    @Override
    protected PropertyType doBuild() {
        PropertyType pt = this.createBean();
        pt.setMnemonic(this.mnemonic);
        pt.setPropertyValueClass(this.propertyValueClass);
        return pt;
    }

    public PropertyTypeBuilder withMnemonic(String mne) {
        this.mnemonic = mne;
        return this;
    }

    public PropertyTypeBuilder withValueClass(Class<? extends AbstractPropertyValue<?>> clazz) {
        this.propertyValueClass = clazz.getName();
        return this;
    }

}
